import { Form, Input, Modal, Select } from "antd";

interface AddUserProps {
  isModalOpen: boolean;
  handleOk: () => void;
  onCancel: () => void;
  form: any;
}

export const AddUser: React.FC<AddUserProps> = ({ isModalOpen, handleOk, onCancel, form }) => {
  return (
    <Modal title="添加用户" open={isModalOpen} onOk={handleOk} onCancel={onCancel}>
      <Form form={form} layout="vertical">
        <Form.Item name="username" label="姓名" rules={[{ required: true, message: "请输入姓名" }]}>
          <Input />
        </Form.Item>
        <Form.Item name="password" label="密码" rules={[{ required: true, message: "请输入密码" }]}>
          <Input.Password />
        </Form.Item>

        <Form.Item name="roleId" label="角色" rules={[{ required: true, message: "请选择角色" }]}>
          <Select>
            <Select.Option value={0}>超级管理员</Select.Option>
            <Select.Option value={1}>普通用户</Select.Option>
          </Select>
        </Form.Item>
      </Form>
    </Modal>
  );
};
